<template>
    <div class="app-container home">
    <!-- <div>  -->
        <!-- <div class="pages dashboard-editor-container"> -->
    <el-tabs v-model="board">
      <el-tab-pane label="直播板卡1" name="1"></el-tab-pane>
      <el-tab-pane label="直播板卡2" name="2"></el-tab-pane>
    </el-tabs>
    <div style="display: flex;justify-content: space-between;" >
    <el-row style="width: 45%;" :gutter="20">
      <el-card class="update-log">
        <div slot="header" class="clearfix">
            <span>高频头1设置分发频道</span>
          </div>
          <el-col :span="12">
           
            <!-- <div style="height: 50%;width: 20%;" > -->
            <el-scrollbar class="right-scrollbar" >
              <el-form  ref="form1"    size="small" label-width="90px" >
              <el-form-item  label="卫星频道" prop="channelBall" style="margin-bottom: 0px;">
                  <div style="align-items: center; display: flex;text-align: center;height: 32px;width: 220px;">
                <el-radio v-model="satelliteType" label="1">高频头1</el-radio>
              </div>
              </el-form-item>
              <el-form-item  label="输出协议" style="margin-bottom: -10px;">
                <el-form-item   style="width: 220px;background-color: antiquewhite; height: 25px;text-align: center;">UTDP-TS</el-form-item>
              </el-form-item> 
              <el-form-item  label="序号" style="margin-bottom: 0px;">
                <div class="boxSear">
                <img class="btnImg" src="../../../../static/lastLab.png" @click="changeGpt('last')">
                <div class="fontShow" style="margin-top: -2px;">
                  {{ gpts[gpt].number }}
                </div>
                <img class="btnImg" src="../../../../static/nextLab.png" @click="changeGpt('next')">
              </div>
              </el-form-item> 
              <el-form-item  label="频点参数" style="margin-bottom: 0px;">
              <div class="boxSear">     <div class="fontShowBox" style="  margin-left: 60px;margin-top: -1px;">
                {{ gpts[gpt].freq }}MHz
              </div>
              </div> 
              </el-form-item> 
              </el-form>
            </el-scrollbar>
          <!-- </div> -->
          </el-col>

        <el-col :span="12">
          <!-- <span style="font-size: 17px;text-align: center;font-weight: bold;">高频头1分发设置区域</span> -->
          <div slot="header" class="clearfix">
            <span>高频头1已分发设置频道</span>
          </div>
      <!-- <div style="height:50%;width: 20%;"> -->
        <BasicTabel  v-if="satelliteType == 1" ref="multipleTable" :ispage="false"  :tableHeight="350"  :config="BasicJson"  :data="tabledata" :pageparm="pageparm" @selection-change="handleSelectionChange"  
          @handleClickOper="handleClickOper">
        </BasicTabel>
      <!-- </div> -->
 
      </el-col>
    </el-card>
    <el-card class="update-log">
      <!-- <el-col :span="24" style="margin: auto;font-size: 17px;text-align: center;font-weight: bold;">高频头1已分发频道</el-col> -->
      <div slot="header" class="clearfix">
            <span>高频头1当前分发频道</span>
          </div>
      <el-col :span="24">
        <div style="font-size: 16px;text-align: center; margin-bottom: 8px; font-weight: bold;height:auto;width: auto;">
        <BasicTabel :ispage="false" :tableHeight="400" :config="BasicFrpJson"  :data="tabledataFrp" :pageparm="pageparm"
          @handleClickOper="handleClickOperFrp">
        </BasicTabel>
        </div>
      </el-col>
</el-card>
    <!-- </div> -->
    </el-row>
<!-- <div style="height: 100px;width: 100%;background-color: white;"></div> -->

<el-row style="width: 50%;">
    <!-- <div style="height: auto;display: flex;justify-content: space-between;" > -->
      <el-card class="update-log">
        <el-col :span="12">
          <div slot="header" class="clearfix">
            <span>高频头2设置分发频道</span>
          </div>
      <!-- <div style="height: 40%;width: 20%;" > -->
        <el-scrollbar class="right-scrollbar" >
          <el-form  ref="form1"    size="small" label-width="90px" >
          <el-form-item  label="卫星频道" prop="channelBall" style="margin-bottom: 0px;">
              <div style="align-items: center; display: flex;text-align: center;height: 32px;width: 220px;">
            <el-radio v-model="satelliteType2" label="2">高频头2</el-radio>
          </div>
          </el-form-item>
           <el-form-item  label="输出协议" style="margin-bottom: -10px;">
            <el-form-item   style="width: 220px;background-color: antiquewhite; height: 25px;text-align: center;">UTDP-TS</el-form-item>
          </el-form-item> 
          <el-form-item  label="序号" style="margin-bottom: 0px;">
            <div class="boxSear">
            <img class="btnImg" src="../../../../static/lastLab.png" @click="changeGpt2('last')">
            <div class="fontShow" style="margin-top: -2px;">
              {{ gpts2[gpt2].number }}
            </div>
            <img class="btnImg" src="../../../../static/nextLab.png" @click="changeGpt2('next')">
          </div>
          </el-form-item> 
          <el-form-item  label="频点参数" style="margin-bottom: 0px;">
          <div class="boxSear">     <div class="fontShowBox" style="  margin-left: 60px;margin-top: -1px;">
            {{ gpts2[gpt2].freq }}MHz
          </div>
          </div> 
          </el-form-item> 
          </el-form>
        </el-scrollbar>
      <!-- </div> -->

      </el-col>
      <el-col :span="12">
      <!-- <div style="height: 40%;width: 20%;"> -->
        <BasicTabel v-if="satelliteType2 == 2" ref="multipleTable2" :ispage="false"  :tableHeight="350" :config="BasicJson"  :data="tabledata2" :pageparm="pageparm" @selection-change="handleSelectionChange2"  
          @handleClickOper="handleClickOper">
        </BasicTabel>
      <!-- </div> -->
      </el-col>
      <el-col :span="24">
        <div slot="header" class="clearfix">
            <span>高频头2当前分发频道</span>
          </div>
      <div style="font-size: 16px;text-align: center; margin-bottom: 8px; font-weight: bold;height:auto;width: auto;">
        <BasicTabel :ispage="false" :tableHeight="400" :config="BasicFrpJson"  :data="tabledataFrp2" :pageparm="pageparm"
          @handleClickOper="handleClickOperFrp">
        </BasicTabel>
      </div>
      </el-col>
</el-card>

  </el-row>
</div>
      <div style="text-align: center; margin-top: 30px;">
          <el-button type="primary" @click="setFrp"  >保存</el-button>
          <el-button>取消</el-button>
        </div>
    </div>
  
</template>
<script>
// import { getLogByDate, getLogNumber, getLogDateList, searchProg, satelliteLogin, getTunerInfo, satelliteScan, startChannelScan, lockTuner, stopChannelScan, getPrfData, getServiceInfo, setPrfData, restprogramDbs, restoreFactory } from '@/api/locationMG'
import { listOutputSet,getServiceInfoDataList,getPrfDataList,setPrfDataSave,refushFrequencyGpt,setMainFreqEx } from "@/api/system/outputSet";

import { getGpts } from '@/api/utils'

import BasicTabel from '@/components/table/table.vue'
import BasicJson from './weixingJson.json'
import BasicFrpJson from './weixingFrpJson.json'

export default {
  components: {
    BasicTabel,
  },
  dicts: ['sys_notice_status', 'sys_notice_type','sys_channel_balls','sys_channel_type'],
  data () {
    return {
      timer: null,
      timers: null,
      flag: true,
      timerScan: null,
      token: '',
      board: '1',
      currentTab: '1_01',
      searchTv: 0,
      fenfaip: '',
      fenfaduankou: '',
      pl: '12020',
      fhl: '28800',
      outVisible: false,
      BasicJson: BasicJson,
      BasicFrpJson: BasicFrpJson,
      handleSelectionChangedata: '',
      handleSelectionChangedata2: '',
      serviceinfo1:null,
      serviceinfo2:null,
      balls: [{ name: '中星9号', key: 0 }, { name: '中星9B', key: 1 },],
      ball: 0,
      numbers: [],
      num: 0,
      // freq: '',
      gpts: getGpts(),
      gpt: 0,
      gpts2: getGpts(),
      gpt2: 0,
      // pl: '12020',
      // fhl: '28800',
      // jhfs: '右旋',
      signalLevel: 0,
      signalQuality: 0,
      signalLevel1: 0,
      signalQuality1: 0,
      multipleTable:[],
      multipleTable2: [], 
      satelliteType: '1', // 版卡
      satelliteType2: '2',
      tabledata: [],
      tabledata2: [],
      tabledataFrp: [],
      tabledataFrp2: [],
      allData: [],
      allData2: [],
      logData: [],
      tsList: [],
      frpInfo: {},
      pageparm: {
        currentPage: 1,
        pageSize: 10,
        total: 10
      },
      curentTime: '',
      loading: null,
      // 表单参数
      // form1: {
      //   channelBall: "1",
      //   number : 1,
      //   frequency: 120,
      //   symbolRate: 288,
      //   channelType: "1",
      //   satellite: 1.
      // },
    }
  },
  watch: {
    satelliteType: function (newval, oldval) {
      console.log('高频头监听值变化satelliteType', newval, oldval);
      // this.getList(newval);
      this.getList(0);
    },
    board: function (newval, oldval) {
      console.log('直播板卡变化', newval, oldval);
      // this.getList(newval);
      this.getList(0);
    }
},
  created() {
    console.log("list================"+this.gpt+"============"+this.gpts.length)
    this.getList(0);
  },
  methods: {
    /** 查询频道管理列表 */
    getList(val) {
      console.log("getList: val:"+val);
      this.loading = true;
      var freq = this.gpts[this.gpt].freq;
      var freq2 = this.gpts2[this.gpt2].freq;
      if(val == 1){
        freq = this.gpts[this.gpt].freq;
      }else if(val == 2){
        freq2 = this.gpts2[this.gpt2].freq;
      }else{

      }

      console.log("getList初始化查询条件:"+JSON.stringify(this.gpt)+"====val========"+val);
      listOutputSet({
          "satellite": this.satelliteType,
          // "freq": freq,
          // "freq2": freq2,
          "board": this.board,
        }).then(response => {
        var data = response.data;
        // console.log("getList===>listOutputSet=====>向后台获取表单数据:"+JSON.stringify(data));
        this.gpts = data;
        this.gpts2 = data;
        console.log("===listOutputSet===gpt="+JSON.stringify(this.gpt)+"==========");
        // console.log("===listOutputSet===gpt2="+JSON.stringify(this.gpt2)+"==========");
        console.log("===listOutputSet===gpts="+JSON.stringify(this.gpts)+"==========");
        // console.log("===listOutputSet===gpts2="+JSON.stringify(this.gpts2)+"==========");
        this.loading = false;
        this.refushFrequencyGpt({
          "satellite": this.satelliteType,
          "freq": this.gpts[this.gpt].freq,
          "board": this.board,
        },val);
        // console.log("getList===>listOutputSet=====>向后台获取表单数据:"+JSON.stringify(data));
        // console.log("======更新后的数据====="+JSON.stringify(this.gpts[this.gpt].freq));
        // console.log("======更新后的数据====="+JSON.stringify(this.gpts2[this.gpt2].freq));


      }).catch(error => {
        console.log("获取频道信息接口响应:"+error);
        this.$message({ message: '当前获取所有频率数据失败:'+error, type: 'error' })
        return
          });
    },
    handleSelectionChange (val) {
      this.handleSelectionChangedata = val
    },
    handleSelectionChange2 (val) {
      this.handleSelectionChangedata2 = val
    },
    handleClickOperFrp (val, obj) {
      console.log("handleClickOperFrp: "+val, obj)
    },
    handleClickOper (val, obj) {
      console.log("handleClickOper: "+val, obj)
    },

    changeGpt (val) {
      console.log("=======changeGpt===="+val+"========"+this.gpt);
      if (val == 'next') {
        console.log(this.gpts[this.gpt].number+"======next====当前number======next:"+this.gpt);
        if (this.gpt == this.gpts.length - 1) {
          console.log("下一个数据已经到头:"+this.gpt);
          this.gpt = 0
        }else{
          this.gpt++
        }
        
        console.log(this.gpts[this.gpt].number+"======next最新number==========:"+this.gpt);
        console.log("=======next===this.gpt=="+this.gpt);
        console.log("=======next===this.gpts=="+JSON.stringify(this.gpt));
        console.log("=======next===this.gpt2=="+this.gpt2);
        console.log("=======next===this.gpts2=="+JSON.stringify(this.gpt2));
      }
      if (val == 'last') {
        var num = this.gpts[this.gpt].number;
        console.log(num+"======last当前number==========last:"+this.gpt);
        if (this.gpt == 0) {
          console.log("last为0");
          this.gpt = this.gpts.length - 1
          console.log("为0,取最新的num的上一个:"+num);
        }else{
          this.gpt--
        }
        console.log(this.gpts[this.gpt].number+"======last最新number==========:"+this.gpt);
        console.log("=======last===this.gpt=="+this.gpt);
        console.log("=======last===this.gpts=="+JSON.stringify(this.gpts));
      }
      this.getServiceInfoDataList({
        "satellite": this.satelliteType,
        "freq": this.gpts[this.gpt].freq,
        "freq2": this.gpts2[this.gpt2].freq,
        "board": this.board,
      },1);

    },
    changeGpt2 (val) {
      console.log("=======changeGpt2===="+val+"=============gpt2:"+this.gpt2);
      if (val == 'next') {
        if (this.gpt2 == this.gpts2.length - 1) {
          this.gpt2 = 0
          console.log("next最新gpt2:"+this.gpt2);
        }else{
          this.gpt2++
          console.log("最新gpt2:"+this.gpt2);
        }
      }
      if (val == 'last') {
        if (this.gpt2 == 0) {
          this.gpt2 = this.gpts2.length - 1
          console.log("last最新gpt2:"+this.gpt2);
        }else{
          this.gpt2--
          console.log("最新gpt2:"+this.gpt2);
        }
      }
      this.getServiceInfoDataList({
        "satellite": this.satelliteType2,
        "freq": this.gpts[this.gpt].freq,
        "freq2": this.gpts2[this.gpt2].freq,
        "board": this.board,
      },2);

    },
    getServiceInfoDataList(data,val){
      console.log("获取所有:"+JSON.stringify(data)+"========="+val);
      var freq = data.freq;
      var freq2 = data.freq2;
      // val = data.board;
      // console.log("getServiceInfoDataList======请求参数===="+JSON.stringify(data)+"====val=========="+val);
      getServiceInfoDataList(data).then(response =>{
        var dataList = response.data;
        // console.log("getServiceInfoDataList dataList: "+JSON.stringify(dataList));
        this.allData2 = dataList.sysChannels2;
        this.allData = dataList.sysChannels1;
        console.log("======val========"+val);
        if(val != 0){
          if(val == 1){
            console.log("===========高频头1");
             //高频头1
            this.tabledata = [];
            for (var obj of this.allData) {
              if (obj.freq == Number(freq)) {
                console.log("高平头1======="+freq+"==========2")
                this.tabledata.push(obj);
              }
            }
          }else if(val == 2){
            console.log("===========高频头2");
            // 高频头2
            this.tabledata2 = [];
          for (var obj of this.allData2) {
              if (obj.freq == Number(freq2)) {
                console.log("高平头2======="+freq2+"==========2")
                this.tabledata2.push(obj);
              }
            }
          }

        }else if(val == 0){
          this.tabledata = [];
          this.tabledata2 = [];
         for (var obj of this.allData) {
            if (obj.freq == Number(freq)) {
              this.tabledata.push(obj);
            }
          }
          for (var obj of this.allData2) {
            if (obj.freq == Number(freq2)) {
              this.tabledata2.push(obj);
            }
          }
        }

        console.log("===================val:========================================="+val);
        console.log("===================map1:"+JSON.stringify(this.handleSelectionChangedata));
        console.log("===================map2:"+JSON.stringify(this.handleSelectionChangedata2));
        // console.log("allData=="+JSON.stringify(this.allData));
        // console.log("allData2=="+JSON.stringify(this.allData2));
        this.loading = false;


        this.getPrfDataList({
          "satellite": this.satelliteType,
          "freq": freq,
          "board": this.board,
        },val);

      }).catch(error => {
        console.log("获取频道信息接口响应:"+error);
        this.$message({ message: '当前获取所有频道失败:'+error, type: 'error' })
        return
        });
    },
    getPrfDataList(data,val){
      // console.log("====getPrfDataList==========="+JSON.stringify(data)+"=======val:"+val);
      getPrfDataList(data).then(response =>{
        var data = response.data;
        this.tabledataFrp = data.data[0].serviceinfo;
        this.tabledataFrp2 = data.data[1].serviceinfo;
        if(val != 0){
          if(val == 1){
            this.findCommonIds(this.tabledataFrp, this.allData);
          }else if(val == 2){
            this.findCommonIds2(this.tabledataFrp2, this.allData2);
          }
        }else{
          this.findCommonIds(this.tabledataFrp, this.allData);
          this.findCommonIds2(this.tabledataFrp2, this.allData2);
          this.$message({ message: '当前分发节目获取成功', type: 'success' })
        }

        console.log("=============================getPrfDataList: val: "+val);
        console.log("================getPrfDataList===map1:"+JSON.stringify(this.handleSelectionChangedata));
        console.log("===============getPrfDataList====map2:"+JSON.stringify(this.handleSelectionChangedata2));
        
        
      }).catch(error => {
        console.log("获取已分发频道接口响应:"+error);
        this.$message({ message: '当前分发节目获取失败:'+error, type: 'error' })
        return
          });
    },
    refushFrequencyGpt(data,val){
      refushFrequencyGpt(data).then(response =>{
        var dataList = response.data;
        // 获取 sysFreqs1 对应的值
        this.gpts = dataList.sysFreqs1;
        this.gpts2 = dataList.sysFreqs2;
        // console.log(this.gpts[0].freq+"========refushFrequencyGpt===gpts2===="+this.gpts2[0].freq+"============gpts======="+this.gpts[0].freq);
        // this.gpts = dataList.sysFreqs1
        var num1 = dataList.gpts;
        var num2 = dataList.gpts2;

        console.log(num1+"============"+num2);

        this.gpt = num1;
        this.gpt2 = num2;

        var freq = this.gpts[this.gpt].freq;
      var freq2 = this.gpts2[this.gpt2].freq;
      console.log("refushFrequency=====gpt========"+this.gpt+"=======gpt2===="+this.gpt2+"======val============"+val);
      // console.log("freq: "+freq+"********************freq2: "+freq2);
      this.getServiceInfoDataList({
          "satellite": this.satelliteType,
          "freq": freq,
          "freq2": freq2,
          "board": this.board,
        },val);
      }).catch(error => {
        let errorMessage = '';
        if (error.message.includes('timeout of')) {
            // 提取超时时间
            const match = error.message.match(/timeout of (\d+)ms exceeded/);
            if (match) {
                const timeout = match[1];
                // errorMessage = `请求超时，超时时间为 ${timeout} 毫秒。`;
                errorMessage = `请求超时,请检查网络连接`;
            } else {
                errorMessage = '请求超时，请检查网络连接';
            }
            this.$modal.alertError(errorMessage);
        } else {
            this.$modal.alertError(error);
        }
     
        return;
      });

    },

    findCommonIds(array1, array2) {  
      // console.log("高频头1==========111", JSON.stringify(array1));
      // console.log("高频头1==========222", JSON.stringify(array2));
      let result = [];  
      for (let i = 0; i < array1.length; i++) {  
          for (let j = 0; j < array2.length; j++) {  
              if (array1[i].id == array2[j].svid) {  
                  result.push(array2[j]); // 或者 array2[j]，取决于你需要哪个数组中的项  
                  break; // 找到匹配项后，可以跳出内层循环  
              }  
          }  
      }  
      // console.log("高频头1==========89898989898", JSON.stringify(result));
      this.$nextTick(() => {  
          // 使用 table 的 toggleRowSelection 方法来选中行  
          this.$refs.multipleTable.toggleSelection(result) 
        }); 
      return result;  
    },

    findCommonIds2(array1, array2) {  
      // console.log("高频头2==========111", JSON.stringify(array1));
      // console.log("高频头2==========222", JSON.stringify(array2));
      let result = [];  
      for (let i = 0; i < array1.length; i++) {  
          for (let j = 0; j < array2.length; j++) {  
              if (array1[i].id == array2[j].svid) {  
                  result.push(array2[j]); // 或者 array2[j]，取决于你需要哪个数组中的项  
                  break; // 找到匹配项后，可以跳出内层循环  
              }  
          }  
      }  
      // console.log("高频头2======89898989898", JSON.stringify(result));
      this.$nextTick(() => {  
          // 使用 table 的 toggleRowSelection 方法来选中行  
          this.$refs.multipleTable2.toggleSelection(result) 
        }); 
      return result;  
    },

    setFrp() {
      this.reqdata = this.allData.filter(item => {
        return item.freq == this.gpts[this.gpt].freq
      })
      this.reqdata2 = this.allData2.filter(item => {
        return item.freq == this.gpts2[this.gpt2].freq
      })

      // console.log("====reqdata===="+JSON.stringify(this.reqdata));
      // console.log("====reqdata2===="+JSON.stringify(this.reqdata2));
      console.log("==========reqdata.length:"+this.reqdata.length);
      console.log("==========reqdata2.length:"+this.reqdata2.length);
      if (this.reqdata.length == 0 && this.reqdata2.length == 0) {
        // this.$message({ message: '暂无节目，无法保存' })
        this.$modal.alertError("暂无节目，无法保存");
        return
      }
      console.log("保存数据1==============:"+JSON.stringify(this.handleSelectionChangedata.length));
      console.log("保存数据2==============:"+JSON.stringify(this.handleSelectionChangedata2.length));
      //校验保存的数据,高频头1和高频头2不允许一个频道分配给多个高频头
      var size1= this.handleSelectionChangedata.length;
      var size2= this.handleSelectionChangedata2.length;
      if (size1 != 0 && size2 != 0) {
        var dataGroup1 =  this.handleSelectionChangedata.map(item => {
              return {
                "name": item.name,
              }
            })
           var names1 = dataGroup1.map(item => item.name);
        var dataGroup2 = this.handleSelectionChangedata2.map(item => {
              return {
                "name": item.name,
              }
            })
            var names2 = dataGroup2.map(item => item.name);
            // console.log("校验选中的数据:"+JSON.stringify(dataGroup1)+"============="+JSON.stringify(dataGroup2));
      }
    
    
    if(size1 != 0){
      this.serviceinfo1 = this.handleSelectionChangedata.map(item => {
              return {
                "name": item.name,
                "id": item.pmtpid,
                "ip": item.ip,
                "port": Number(item.port),
                "protocol": item.protocol?item.protocol:'udp',
                "url": item.url?item.url:'',
              }
            })
    }else{
      this.serviceinfo1 = [];
    }
    if(size2 != 0){
      this.serviceinfo2 = this.handleSelectionChangedata2.map(item => {
              return {
                "name": item.name,
                "id": item.pmtpid,
                "ip": item.ip,
                "port": Number(item.port),
                "protocol": item.protocol?item.protocol:'udp',
                "url": item.url?item.url:'',
              }
            })
    }else{
      this.serviceinfo2 = [];
    }
    var tmp = 17
      if (this.jhfs == '左旋') {
        tmp = 2
      } else {
        tmp = 3
      }

        setMainFreqEx({
          "bordId":this.board,
          "deliveryParam":[
            {
              "frequency":this.reqdata[0].freq,
              "symbolRate": Number(this.fhl),
              "polarization": Number(tmp),
            },{
              "frequency":this.reqdata2[0].freq,
              "symbolRate": Number(this.fhl),
              "polarization": Number(tmp),
            }
          ]
        }).then(response =>{
            console.log("setMainFreqEx====="+JSON.stringify(response));
            if(response.data){
              this.setPrfDataSave({
                "satellite": this.satelliteType,
                "board":this.board,
                "serviceInfo": [
                  {
                    // "deliveryType": this.reqdata[0].deliveryType,
                    "frequency": this.reqdata[0].freq,
                    // "polarization": this.reqdata[0].polarization,
                    // "symbolRate": this.reqdata[0].symbolRate,
                    "onid": this.reqdata[0].onid,
                    "tsid": this.reqdata[0].tsid,
                    "serviceinfo": this.serviceinfo1,
                  },
                  {
                    // "deliveryType": this.reqdata2[0].deliveryType,
                    "frequency": this.reqdata2[0].freq,
                    // "polarization": this.reqdata2[0].polarization,
                    // "symbolRate": this.reqdata2[0].symbolRate,
                    "onid": this.reqdata2[0].onid,
                    "tsid": this.reqdata2[0].tsid,
                    "serviceinfo": this.serviceinfo2,
                  }
                ]
              });
              console.log("保存成功");
            }else{
              this.$message({ message: '重新分发频道保存失败:', type: 'error' })
            }
          }).catch(error => {
            // this.$message({ message: '操作失败1111:'+error, type: 'error' })
            this.$modal.alertError(error);
            return
          });
   
  },
  setPrfDataSave(data){
    console.log("开始进行保存");
    setPrfDataSave(data).then(res => {
        this.getList(0);
        if (res.code == 200) {
          var checkResult = res.data;
          if(checkResult.flag){
            this.$message({ message: '重新分发节目成功', type: 'success' })
          }else{
            //页面提示保存操作时,可能出现的校验错误
            this.$modal.alertError(checkResult.message);
          }
        }else{
          this.$modal.alertError("重新分发节目失败:"+res.msg);
        }
      }).catch(error => {
        console.log("设置分发频道接口响应:"+error);
        return
          });
        }
          
  },
}
</script>
<style scoped>
.title {
  width: 100px;
  font-size: 14px;
}

.boxCon {
  width: 200px;
  background-color: antiquewhite;
  height: 25px;
}

.boxSear {
  width: 160px;
  background-color: antiquewhite;
  height: 25px;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.btnImg {
  width: 15px;
  height: 15px;
  margin-top: 5px;
  cursor: pointer;
}

.fontShow {
  margin-top: 8px;
  font-size: 12px;
}

.disBox {
  display: flex;
}
.disBox1 {
  display: flex;
  margin-bottom: 10px;
}

.progress {
  height: 50px;
  /* background-color: antiquewhite; */
}

.proBox {
  width: 200px;
  height: 25px;
  border: 1px solid antiquewhite;
}

.fontShowBox {
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
}

.proLen {
  font-size: 18px;
  font-weight: bold;
  margin: 1px 8px;
}

.backWork {
  width: 100%;
  height: 60vh;
}
</style>
<style scoped>
.title {
  width: 90px;
  height: 30px;
  font-size: 14px;
  text-align: right;
}

.boxCon {
  width: 220px;
  background-color: antiquewhite;
  height: 25px;
}

.boxSear {
  width: 220px;
  background-color: antiquewhite;
  height: 25px;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.btnImg {
  width: 15px;
  height: 15px;
  margin-top: 5px;
  cursor: pointer;
}

.fontShow {
  margin-top: 8px;
  font-size: 12px;
}

.disBox {
  display: flex;
}

.progress {
  height: 50px;
  /* background-color: antiquewhite; */
}

.proBox {
  width: 200px;
  height: 25px;
  border: 1px solid antiquewhite;
}

.fontShowBox {
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
}

.proLen {
  font-size: 18px;
  font-weight: bold;
  margin: 1px 8px;
}

.backWork {
  width: 100%;
  height: 60vh;
}
.text {
  text-align: center;
}

.update-log {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
  }
</style>
